// 用户列表     模块

//引入mongoose模块
const mongoose = require('mongoose');
const { Schema } = mongoose;

//创建userSchema数据库模型
const userSchema = new Schema({
    userName: String,
    userPwd: String,
    userId: Number,
    userEmail: String,
    state: Number,
    mobile: Number,
    role: String,
    job: String,
    sex: String,
    roleList: [],
    deptId: [],
    createTime: {
        type: Date,
        default: Date.now
    },
    lastLoginTime: {
        type: Date,
        default: Date.now
    }
});

//定义user模型并导出
module.exports = mongoose.model('user', userSchema)